package com.example.database;

public class Client {
    public static void main(String[] args) {
        // 使用MySQL数据库
        System.out.println("使用MySQL数据库：");
        IFactory factory = new MySQLFactory();
        IUser user = factory.createUser();
        IConnection connection = factory.createConnection();
        user.getUser();
        connection.getConnection();

        System.out.println("\n切换到Oracle数据库：");
        // 切换到Oracle数据库
        factory = new OracleFactory();
        user = factory.createUser();
        connection = factory.createConnection();
        user.getUser();
        connection.getConnection();
    }
}